package cn.zust.ly.EyExample.Ey04;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		//int a[] = new int[n];
		int max,min,sun;
		int y = sc.nextInt();
		max = min = sun = y;
		for (int i = 1; i < n; i++) {
			//a[i] = sc.nextInt();
			int x = sc.nextInt();
			sun += x;
			if (x > max) max = x;
			if (x < min) min = x;
		}
		System.out.println(max);
		System.out.println(min);
		System.out.println(sun);
		
	}
}
